package lambda;

import java.io.File;
import java.io.FileFilter;

public class LambdaDemo2 {
    public static void main(String[] args) {
        FileFilter filter=new FileFilter() {

            public boolean accept(File f) {
                return f.getName().startsWith(".");
            }
        };
        FileFilter fileFilter2= f->f.getName().startsWith(".");
        //获取当前项目目录下所有名字以"."开始的子项
        File dir=new File(".");
        if (dir.isDirectory()){
            File[] subs=dir.listFiles(f->f.getName().startsWith("."));
            for (File sub:subs){
                System.out.println(sub);
            }
        }
    }
}
